EEL_MODS	+= kmodules

HAVE_KMODULES			:= 0
ifneq ($(wildcard $(G_DEMO_DIR)/$(KM_SRC_DIR)/scripts/Makefile),)
HAVE_KMODULES			:= 1
endif

# qemu /lib/modules/$(uname -r) need kernel-modules_install
ifeq ($(HAVE_KMODULES),1)
PHONY-kmodules += km-%
km-%: $(BUILD_DEPS) $(KL_VMLINUX)
	$(EELQ2)cd $(EEL_DEMO_DIR)/$(KM_SRC_DIR)/$(KM_VER_DIR) \
		&& $(MAKE) \
		HOST=0 \
		ARCH=$(ARCH) \
		$(patsubst km-%,%,$@)

PHONY-kmodules += kmodules kmodules-all kmodules-install kmodules-clean
kmodules: km-all-modules
kmodules-install: km-all-modules_install
kmodules-clean: km-all-clean
endif
